With the great developments in optical communication technology and large-scale optical integration technology, it is imperative to realize the traditional functions of polarization processing on an integration platform. Most of the existing polarization devices, such as polarization multiplexers/demultiplexers, polarization controllers, polarization analyzers, etc., perform only a single function. Definitely, integrating all these polarization functions on a chip will increase function flexibility and integration density and also cut the cost. In this article, we demonstrate an all-in-one chip-scale polarization processor based on a linear optical network. The polarization functions can be configured by tuning the array of phase shifters on the chip. We demonstrate multiple polarization processing functions, including those of a multiple-input-multiple-output polarization descrambler, polarization controller, and polarization analyzer, which are the basic building blocks of polarization processing. More functions can be realized by using an additional two-dimensional output grating. A numerical gradient descent algorithm is employed to self-configure and self-optimize these functions. Our demonstration suggests great potential for chip-scale, reconfigurable, and fully programmable photonic polarization processors with the artificial intelligence algorithm.